// import DiffMatchPatch from 'diff-match-patch';
// const DiffMatchPatch = require('diff-match-patch');
// const dmp = new DiffMatchPatch();
// const test =  dmp.diff_main("123456789", "012356889");
// console.log(test);

const zip = require('./zip');//解压工具
const patch = require('./patch-cli/index');

const md5 = require('./patch-cli/md5');

const options = require('minimist')(process.argv.slice(2));
const {tool} = options;
if(!tool){
    console.error("Error: 请指定一个工具，如 'npm start --tool zip'");
    return;
}

switch (tool){
    case "patch":
        const [current, target] = options._;
        if(!current || !target){
            console.log("Patch Error: 请指定需要增量的两个版本，如'npm run patch --current 0.0.1 --target 0.0.2'");
            return;
        }
        patch(current,target);
        break;

}